

<%@ page import="org.tailor.Orders" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'orders.label', default: 'Orders')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${ordersInstance}">
            <div class="errors">
                <g:renderErrors bean="${ordersInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="ordersID"><g:message code="orders.ordersID.label" default="Orders ID" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'ordersID', 'errors')}">
                                    <g:textField name="ordersID" value="${fieldValue(bean: ordersInstance, field: 'ordersID')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="unit"><g:message code="orders.unit.label" default="Unit" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'unit', 'errors')}">
                                    <g:textField name="unit" value="${fieldValue(bean: ordersInstance, field: 'unit')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="cancelledOrders"><g:message code="orders.cancelledOrders.label" default="Cancelled Orders" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'cancelledOrders', 'errors')}">
                                    <g:textField name="cancelledOrders" value="${fieldValue(bean: ordersInstance, field: 'cancelledOrders')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="client"><g:message code="orders.client.label" default="Client" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'client', 'errors')}">
                                    <g:select name="client.id" from="${org.tailor.Client.list()}" optionKey="id" value="${ordersInstance?.client?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="fulfilled"><g:message code="orders.fulfilled.label" default="Fulfilled" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'fulfilled', 'errors')}">
                                    <g:textField name="fulfilled" value="${fieldValue(bean: ordersInstance, field: 'fulfilled')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="orderDate"><g:message code="orders.orderDate.label" default="Order Date" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'orderDate', 'errors')}">
                                    <g:datePicker name="orderDate" precision="day" value="${ordersInstance?.orderDate}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="orderNumber"><g:message code="orders.orderNumber.label" default="Order Number" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'orderNumber', 'errors')}">
                                    <g:textField name="orderNumber" value="${fieldValue(bean: ordersInstance, field: 'orderNumber')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="paid"><g:message code="orders.paid.label" default="Paid" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'paid', 'errors')}">
                                    <g:textField name="paid" value="${fieldValue(bean: ordersInstance, field: 'paid')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="payment"><g:message code="orders.payment.label" default="Payment" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'payment', 'errors')}">
                                    <g:select name="payment.id" from="${org.tailor.Payment.list()}" optionKey="id" value="${ordersInstance?.payment?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="paymentDate"><g:message code="orders.paymentDate.label" default="Payment Date" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'paymentDate', 'errors')}">
                                    <g:datePicker name="paymentDate" precision="day" value="${ordersInstance?.paymentDate}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="requiredDate"><g:message code="orders.requiredDate.label" default="Required Date" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'requiredDate', 'errors')}">
                                    <g:datePicker name="requiredDate" precision="day" value="${ordersInstance?.requiredDate}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="salesTax"><g:message code="orders.salesTax.label" default="Sales Tax" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'salesTax', 'errors')}">
                                    <g:textField name="salesTax" value="${fieldValue(bean: ordersInstance, field: 'salesTax')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="timestamp"><g:message code="orders.timestamp.label" default="Timestamp" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'timestamp', 'errors')}">
                                    <g:datePicker name="timestamp" precision="day" value="${ordersInstance?.timestamp}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="trasactionStatus"><g:message code="orders.trasactionStatus.label" default="Trasaction Status" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: ordersInstance, field: 'trasactionStatus', 'errors')}">
                                    <g:textField name="trasactionStatus" value="${fieldValue(bean: ordersInstance, field: 'trasactionStatus')}" />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
